<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta content="webkit" name="renderer"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta http-equiv="Expires" content="0"/>
<meta http-equiv="Cache-Control" content="no-cache"/><meta http-equiv="Cache-Control" content="no-store"/>
<meta content="width=device-width, initial-scale=1, user-scalable=1" name="viewport"/>
<meta content="${fns:getConfig('productName')}" name="description"/>
<meta content="http://www.ecode.net.cn" name="author"/>
<title>登录 - ${fns:getConfig('productName')}${" "}${fns:getConfig('version')}</title>
<link rel="shortcut icon" href="${ctxPath}/favicon.ico"/>
<%@ include file="/upbw/upgrade.jsp" %>
<link href="${ctxStatic}/login/css/denglu.css" type="text/css" rel="stylesheet" />
<script src="${ctxStatic}/jquery/jquery-1.11.2.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

</head>
<body>
<body>
<div class="top_bg">
	<div class="top">
<span>


</span>
		<a href="#">乾程便利电管理平台</a></div>
</div>

<div class="banner">
	<div class="d">
		<div class="denglu_bg">
			<form id="loginForm" class="fm-v clearfix" action="" method="post">

			<div class="denglu_t">欢迎登录乾程便利电管理平台</div>
			<p>
				<input type="text" name="username" value="${not empty cookie.rememberUserCode.value ? cookie.rememberUserCode.value : ''}"
				class=" d_t1 required"  />
			</p>

			<p>
				<input id="password" name="password" class="d_t2 required"  type="password" value="" autocomplete="off">
			</p>
				<div class="hide" id="errmsg" style="color:#f00; padding:0px; margin:0px;line-height:25px; font-size:12px;"><span ></span></div>
				<div class="jizhu"><input name="rememberUserCode" ${not empty cookie.rememberUserCode.value ? 'checked' : ''}  type="checkbox" ${rememberMe ? 'checked' : ''} />&nbsp;记住账号&nbsp;&nbsp;<input name="rememberMe" type="checkbox" value=""  /> &nbsp;记住密码&nbsp; &nbsp;<a href="#">忘记密码?</a></div>
			<p><input id="btnLogin"  name="" type="button"  class="d_t5" /></p>
			</form>
		</div>
		<div class="clear"></div>
	</div>
</div>
<div class="bottom_bg">
	<div class="bottom">
		<p>©乾程电力有限公司 技术支持：<a href="http://www.smrwl.com" target="_blank">数码人科技</a>
		</p></div></div>
</body>

<script src="${ctxStatic}/jquery-toastr/2.0/toastr.min.js?${_version}" type="text/javascript"></script>
<script src="${ctxStatic}/assets/global/plugins/jquery-select2/select2.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/jquery-validation/1.11.1/jquery.validate.method.min.js" type="text/javascript"></script>
<script src="${ctxStatic}/common/jeesite.min.js?${_version}" type="text/javascript"></script>
<script src="${ctxStatic}/common/des.min.js?${_version}" type="text/javascript"></script>
<script src="${ctxStaticTheme}/js/jquery.backstretch.min.js"></script>
<script>
	function setHeight(){
		var height = $(window).height() > 610 ? $(window).height()-162 : 610-162;
		$(".login-body").css("height", height+"px");
	}
	setHeight();
	window.onresize=setHeight;
	// 用户名、密码输入框获取焦点、失去焦点时的样式切换
	$(".login").find(".item1,.item2").click(function(){
		$(this).removeClass("item-hover").addClass("item-focus").siblings().removeClass("item-focus");
		$(this).find(".input").focus();
		$(this).find(".input").blur(function () {
			$(this).closest(".item").removeClass("item-focus");
		});
	});
	$('#loginForm').validate({
		submitHandler: function (form) {
			var pwd = $('#password').val(),
				pwdKey = '${fns:getConfig("shiro.loginPassword.secretKey")}';
			if (pwdKey != ''){
				$('#password').val(DesUtils.encode(pwd, pwdKey));
			}
			ajaxSubmitForm($(form), function(data, status, xhr){
				if (data.isValidateCodeLogin == true){
					$('#isValidateCodeLogin').show();
					$('#validateCodeRefresh').click();
				}
				if(data.result == "false" && data.message.length > 0){
					$('#errmsg').removeClass("hide");
					$('#errmsg').html(data.message);
// 					showMessage(data.message);
				}else {
					loading('登录验证成功，正在进入...');
					location = "${ctx}/index";
				}
			}, 'json', true, "正在验证登录，请稍后...");
			$('#password').val(pwd).select().focus();
		}
	});
	$(function(){
		$(".login-body").backstretch("${ctxStaticTheme}/images/login-bg.png");//兼容IE8，背景图片按比例缩放，铺满div
	})
	$("#btnLogin").click(function(){

		$("#loginForm").submit();
	});
</script>
</body>
</html>